<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <script type="text/javascript">
            document.ready=function(){
                var btn1=document.getElementById("click");
                btn1.onclick=function(){
                    var xhr=new XMLHttpRequest();
                    xhr.open("GET","nodetest.js?fname=Bill&lname=Gates",true);
                    xhr.onreadystatechange=function()
                    {
                    if (xhr.readyState==4 && xhr.status==200)
                        {
                        document.getElementById("txt").innerHTML=xmlhttp.responseText;
                        }
                    }
                    xhr.send();
                }
            }
        </script>
    </head>
    <body>
        <input type="button" value="click" id="click" />
        <div id="txt"></div>
    </body>
</html>